<?php

/**
 * SocialEnginePro
 *
 * @category   Application_Extensions
 * @package    tv
 * @author     Azim
 */

/**
 * @category   Application_Extensions
 * @package    tv
 */
class Tv_Widget_CountryController extends Engine_Content_Widget_Abstract {

    public function indexAction() {
        $table = Engine_Api::_()->getDbtable('tvs', 'tv');


        $select = $table->getListTv('country');

        $list = array();
        foreach ($select->toArray() as $key => $value) {
            $list[$value['country']] = Zend_Locale::getTranslation($value['country'], 'territory', $value['country']).'('.$value['count'].')';
        }
        $this->view->country = $list;

        // Set item count per page and current page number
//        $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 3));
//        $paginator->setCurrentPageNumber($this->_getParam('page', 1));
//
        if (count($list)<= 0) {
            return $this->setNoRender();
        }
    }

}